<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas学习</title>
</head>
<body>
    <canvas id="tutorial">你的浏览器不支持 canvas，请升级你的浏览器。</canvas>
    <script>
        let canvas = document.getElementById('tutorial');
        //获得 2d 上下文对象
        if(canvas.getContext){
            let ctx = canvas.getContext('2d');
        }else{
            // canvas-unsupported code here
        }
    </script>
</body>
</html>